﻿package src.com.rageSteroid {
	
	import flash.display.Sprite
	import flash.events.Event;
	
	public class Laser extends Sprite{
		
		public function Laser(){
			trace("LE LASER");
			this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
		}
		private function onAddedToStage(event:Event):void{
			this.removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
			this.graphics.beginFill(0x2500FF);
			this.graphics.lineStyle(3,0x8899FF);
			this.graphics.drawRoundRect(-2,2,8,30,3);
			this.rotation = (180*Math.atan2(stage.mouseY-this.y,stage.mouseX-this.x))/Math.PI + 90;
		}
	}	
}